criteria fonksiyonu
merhaba batarya durumuna göre bulundugum konumu belli zaman aralıgında göndermeye çalısıyorum Bataryam %33 oldugu halde power hight a gidiyor sizce sebebi ne olabilir?? setPowerRequirement neye göre bataryanın medium,low,hight oldugunu anlayabiliyor
try{
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setPowerRequirement(Criteria.POWER_MEDIUM);
criteria.setCostAllowed(false); // konum servis ucreti...vs
String providerNamedium =locationManager.getBestProvider(criteria,true);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,timedium, 0, locationListener);
abc.setText("medium");
}
catch(Exception ex){
hata.setText("hata MEDİUM");
}
try{
Criteria critlow =new Criteria();
critlow.setAccuracy(Criteria.ACCURACY_FINE);
critlow.setPowerRequirement(Criteria.POWER_LOW);
critlow.setCostAllowed(false);
String providerNamelow=locationManager.getBestProvider(critlow, true);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,timelow, 0, locationListener);
abc.setText("low");
}
catch(Exception ex){
hata.setText("hata LOW");
}
try{
Criteria crithight=new Criteria();
crithight.setAccuracy(Criteria.ACCURACY_FINE);
crithight.setPowerRequirement(Criteria.POWER_HIGH);
crithight.setCostAllowed(false);
String providerNamehight=locationManager.getBestProvider(crithight, true);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,timehight, 0, locationListener);
abc.setText("hight");
}
catch(Exception ex)
{
hata.setText("hata HİGHT");
}